/*cnpm install express --save*/
/*cnpm install cors --save*/

var Express = require('express') ;
var cors=require('cors') ;
var app = new Express();

app.use(cors());

//创建后台数据的路由
var userRouter = require('./router/basic/user') ;
var goodsRouter = require('./router/basic/mysql') ;
var mapRouter = require('./router/basic/map') ;
var lxtsqlRouter = require('./router/basic/lxtsql');


/*创建服务器端路由*/
app.use('/user',userRouter);
app.use('/goods' , goodsRouter) ;
app.use('/map' , mapRouter) ;
app.use('/lxtsql' , lxtsqlRouter) ;


var testRouter = require('./router/test') ;
app.use('/test',testRouter);

var server=app.listen('3000','localhost',function (req,res) {

    var host= server.address().address;
    var post=server.address().port;

    console.log('the server in running on http://%s:%s',host,post);

}) ;
